import MySql.goodsManager;
import MySql.introducesManager;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class DeleteGoodsServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        String id=request.getParameter("id");
        Boolean flag=false;
        flag= goodsManager.deleteGood(id);
        if(flag){
            response.sendRedirect("manager.jsp#goods");
        }else{
            response.sendRedirect("fail.jsp");
        }
    }
}
